1. Field of the Invention
The present invention relates to an apparatus which detects a document region from the image signal obtained by reading a document placed on a platen and a method thereof.
2. Description of the Related Art
There is known an image reading apparatus (scanner) which optically reads a document, photograph, or the like and converts the read image into electronic data. Some of such scanners and some applications designed to process read images have a function called a crop, which cuts out part of an image. This crop function includes a manual crop of allowing the user to cut out an arbitrary region while seeing the screen, and an automatic crop that is independent of user designation.
A conventional automatic crop function reads an image of a document in a region equivalent to a platen and detects the edge of the document based on a difference in color such as luminance and chroma in the read image or by an edge extraction filter, thereby extracting an image region on the document.
Japanese Patent Laid-Open No. 7-170405 discloses a technique of detecting a document region by detecting a signal representing the shadow of the edge of a document based on a density value from the image signal obtained from the document. Japanese Patent Laid-Open No. 11-008764 discloses a technique of extracting only the image data of a document portion by switching thresholds for detecting a document region in accordance with a read position when detecting a document region from the image data obtained by reading the document.
If a document is a photographic document, since the entire surface of the document is colored, it is easy to crop upon detecting only a document portion. This is because the cover of a platen as the background of a read image is generally white, and hence it is easy to discriminate a document portion from a background portion.
To the contrary, many text documents have margins, so it is not easy to discriminate a document portion of an original text document from a background portion. For this reason, cropping only an image portion of the original text document may change the size of the text document or divide the text document into a plurality of regions depending on a document image. In such a case, the read image data differs in layout from the original text document.